<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="Doc.css" rel="stylesheet"/>
<title>TreeGrid - Adding and copying rows</title>
</head>
<body>
<div class="Doc">


<h1>Row adding and copying</h1>
<p>TreeGrid documentation</p>

Only variable rows can be added or copied.<br />
Fixed (Head and Foot) and Space rows <u>cannot</u> be added or copied.<br />

<!------------------------------------------------------------------ Ways of adding rows to grid -------------------------------------------------------------->
<a name="Ways"></a>
<h2>Ways of adding rows to grid</h2>

<h6>Adding new empty row</h6>
New empty row can be added by actions <b>AddRow</b>, <b>AddChild</b> and other <b>Add</b>... actions. These actions are usually attached to Toolbar <b>Add</b> and <b>AddChild</b> Button and also to <a href="#PanelCopyMenu">CopyMenu</a> menu.<br />
By API can be new row added by <a href="#AddRow">AddRow</a> method.<br />
<i>All the settings are described below in <a href="#Adding">Adding new empty rows paragraph</a>.</i><br />

<h6>Copying existing row</h6>
Existing row can be copied by actions <b>CopyRow</b>, <b>CopyTree</b>, <b>CopySelected</b> and other <b>Copy</b>...action. These actions are usually accessible from <a href="#CopyRows">CopyMenu</a> menu.<br />
It is possible to copy row only, copy row with children, copy row with children, but without values, copy selected rows - with or without children.<br />
By API can be existing rows copies by <a href="#CopyRows">CopyRows</a> method.<br />
<i>All the settings are described below in <a href="#Copying">Copying existing rows paragraph</a>.</i><br />

<h6>Copying existing row by dragging</h6> 
Existing rows can be copied when dragging by actions <b>DragCopy</b>, <b>DragSelectedCopy</b>, <b>DragCopyChildren</b>. These actions are not attached to any event by default, because by default are rows moved by dragging.<br /> 
The copying actions can be attached to <b>OnDrag...</b> events and replace DragRow, DragSelected and DragChildren events that move the rows.<br />
<i>All the settings are described in <a href="RowMove.htm">Row moving documentation</a>.</i><br />

<h6>Moving existing row from another grid by dragging</h6>
From another grid are rows move always as copy - from source grid are deleted (marked as Deleted) and added as new to the destination grid.<br />
The dragging rows can be done by actions <b>DragRow</b>, <b>DragSelected</b> and <b>DragChildren</b> events. These actions are usually attached as default actions for dragging rows to <b>OnDrag</b> event.<br />
By API can be rows moved from another grid by <b>MoveRowsToGrid</b> method.<br />
<i>All the settings are described in <a href="RowMove.htm">Row moving documentation</a>.</i><br /> 

<h6>Pasting row from clipboard</h6> 
TreeGrid supports pasting new rows from clipboard. To clipboard can be rows copied from the grid, from another grid, or from another application like MS Excel.<br />
The pasting is done by actions <b>PasteTo...</b> These actions are attached to CtrlV event and cannot be attached alsewhere.<br />
<i>All the settings are described in <a href="CopyPaste.htm">Copy&Paste documentation</a>.</i><br />

<!--------------------------------------------------------------- Adding and copying restrictions -------------------------------------------------------------->
<a name="Restrictions"></a>
<h2>Adding and copying restrictions</h2>
By default every row accepts every child. Remember, only variable rows can be added or copied!<br />
To control which row accepts which child use <b>Def</b> and <b>AcceptDef</b> attributes. The row accepts as child only rows with <b>Def</b> attribute listed in the row's <b>AcceptDef</b> array. The root rows are controlled by &lt;Root <b>AcceptDef</b>/>.<br />
The new empty row gets its <b>Def</b> attribute from <b>CDef</b> attribute of its parent. Root rows use &lt;Root <b>CDef</b>/>. To restrict adding to row's children, set its <tt><b>CDef</b>=""</tt>. By default is <tt><b>CDef</b>="R"</tt>.<br />
Dynamically you can control adding new rows by API event <a href="#OnCanRowAdd">OnCanRowAdd</a>.<br />
<i>All the settings are described in <a href="RowDefaults.htm">Default rows documentation</a>.</i><br />

<!--------------------------------------------------------------- Adding new empty rows -------------------------------------------------------------->
<a name="Adding"></a>
<h2>Adding new empty rows</h2>

<!-- Adding -->
<a name="CfgAdding"></a>
<div class="XML">
   <u></u> <b>&lt;Cfg></b> <i>bool</i>
   <h4>Adding</h4><s>[1]</s>
</div>
If rows can be added into grid.<br />
If set to 0, grid does <u>not</u> permit adding new rows, copying existing rows and pasting rows from clipboard, but it is still permitted moving rows from another grid.<br />
If set to 0, it hides Toolbar buttons Add and AddChild. If set to 0 all <b>Add</b>... actions fail, but <a href="#AddRow">AddRow</a> method still works.<br />

<!-- AddFocusCol -->
<a name="CfgAddFocusCol"></a>
<div class="XML">
   <u>new <b>6.4</b></u> <b>&lt;Cfg></b> <i>string</i>
   <h4>AddFocusCol</h4><s></s>
</div>
When set, automatically focuses this column after the row is added.<br />
If not set, the originally focused column is used.<br /> 

<!-- AddFocusColEmpty -->
<a name="CfgAddFocusColEmpty"></a>
<div class="XML">
   <u>new <b>14.0</b></u> <b>&lt;Cfg></b> <i>string</i>
   <h4>AddFocusColEmpty</h4><s></s>
</div>
When set, automatically focuses this column after the row is added if no column is focused originally.<br />

<!-- Added -->
<a name="IAdded"></a>
<div class="XML">
   <u></u> <b>&lt;I></b> <i>bool</i>
   <h4>Added</h4>
   <s>[0] &nbsp;	Uploaded to server, support Undo</s>
</div>
It is set to <b>1</b> when row has been added to the grid and not yet uploaded to server.<br /> 
<strong>It is set to <b>1</b> for every type of adding the row (add empty, copy, drag copy, move from other grid, paste).</strong><br />
Added row is colored green (by default setting in Grid.css).<br />
After uploading changes to server or calling <a href="DataUpload.htm#AcceptChanges">AcceptChanges</a> the added row just looses its state and becomes normal row.<br />
The place where the row is added is identified by <a href="#IParent">Parent</a>, <a href="#INext">Next</a> and <a href="#IPrev">Prev</a> attributes.<br />

<!-- Parent -->
<a name="IParent"></a>
<div class="XML">
   <u></u> <b>&lt;I></b> <i>string</i>
   <h4>Parent</h4>
   <s>Uploaded to server</s>
</div>
When the row is moved or added, this is id of the new parent row or position of page (from 0).<br />

<!-- Next -->
<a name="INext"></a>
<div class="XML">
   <u></u> <b>&lt;I></b> <i>string</i>
   <h4>Next</h4>
   <s>Uploaded to server</s>
</div>
When the row is moved or added, this is id of the row below or "" if the row is the last row in its parent.<br />

<!-- Prev -->
<a name="IPrev"></a>
<div class="XML">
   <u></u> <b>&lt;I></b> <i>string</i>
   <h4>Prev</h4>
   <s>Uploaded to server</s>
</div>
When the row is moved or added, this is id of the row above or "" if the row is the first row in its parent.<br />

<!-- AddParent -->
<a name="IAddParent"></a>
<div class="XML">
   <u></u> <b>&lt;I> &lt;Root></b> <i>int</i>
   <h4>AddParent</h4><s>[0]</s>
</div>
If set, adds new row's children as its siblings rather than its children.<br />
If is set to <b>1</b> adds new row before the row.<br />
If is set to <b>2</b> adds new row as last child of the parent row.<br />
For example, if you set AddParent of all rows and &lt;Root> to <b>2</b>, every new row will be added to the end of table, to the root.<br />

<!-- Action AddRow -->
<a name="ActionsAddRow"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>AddRow <i>...<a href="Events.htm#Suffix">FA</a></i></h4>
   <s>Attached to <b>OnClickButtonAdd</b> and <b>OnIns</b> and used in <b>Toolbar Add</b> and <b>Panel</b> <a href="CellBasics.htm#CMenu">Menu</a></s>
</div>
Adds new empty row above actual or focused row.<br />

<!-- Action AddRowBelow -->
<a name="ActionsAddRowBelow"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>AddRowBelow <i>...<a href="Events.htm#Suffix">FA</a></i></h4>
   <s>Not attached to any event</s>
</div>
Adds new empty row below actual or focused row.<br />

<!-- Action AddRowEnd -->
<a name="ActionsAddRowEnd"></a>
<div class="ACT">
   <u><i>upd <b>14.0</b></i></u> <b>&lt;Actions></b> <i></i>
   <h4>AddRowEnd</h4>
   <s>Attached to <b>OnClickButtonAdd</b> event and used in <b>Toolbar</b> <a href="CellBasics.htm#CMenu">Menu</a></s>
</div>
Adds new empty row to the end of grid (when <tt>&lt;Cfg AllPages='1'/></tt>) or actual page (when <tt>&lt;Cfg AllPages='0'/></tt>).<br />
There are also available actions <b>AddRow<u>EndGrid</u></b> to add row to the grid end and <b>AddRow<u>EndPage</u></b> to add row to actual page end.<br />
It always creates brand new row and ignores <a href="CellEdit.htm#CfgEditAttrsEmpty">EditAttrsEmpty</a> attribute.<br />
<i>Since 14.0</i> it can be used with F suffix to add row to end of focused nested grid if any.<br />

<!-- Action AddChild -->
<a name="ActionsAddChild"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>AddChild <i>...<a href="Events.htm#Suffix">FA</a></i></h4>
   <s>Not attached to any event</s>
</div>
Adds new empty row into actual or focused row's children to the beginning (as the first child).<br />

<!-- Action AddChildEnd -->
<a name="ActionsAddChildEnd"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>AddChildEnd <i>...<a href="Events.htm#Suffix">FA</a></i></h4>
   <s>Attached to <b>OnClickButtonAddChild</b> and <b>OnCtrlIns</b> and used in <b>Toolbar AddChild</b> and <b>Panel</b> <a href="CellBasics.htm#CMenu">Menu</a></s>
</div>
Adds new empty row into actual or focused row's children to the end (as the last child).<br />

<!-- Action AddRows -->
<a name="ActionsAddRows"></a>
<div class="ACT">
   <u>new <b>12.0</b></u> <b>&lt;Actions></b> <i></i>
   <h4>AddRows <i>...<a href="Events.htm#Suffix">FSARWO</a></i></h4>
   <s>Not attached to any event, used in <b>Toolbar Add</b> <a href="CellBasics.htm#CMenu">Menu</a></s>
</div>
Adds new empty rows above actual row or focused range. 
It adds the same number of rows as the focused range contains.
The suffixes <b>FA</b> control destination (the position to add), the suffixes <b>SRWO</b> control source (the count).<br />

<!-- Action AddRowsBelow -->
<a name="ActionsAddRowsBelow"></a>
<div class="ACT">
   <u>new <b>12.0</b></u> <b>&lt;Actions></b> <i></i>
   <h4>AddRowsBelow <i>...<a href="Events.htm#Suffix">FSARWO</a></i></h4>
   <s>Not attached to any event</s>
</div>
Adds new empty rows below actual row or focused range. 
It adds the same number of rows as the focused range contains.<br />
The suffixes <b>FA</b> control destination (the position to add), the suffixes <b>SRWO</b> control source (the count).<br />

<!-- Action AddSelected -->
<a name="ActionsAddSelected"></a>
<div class="ACT">
   <u>new <b>12.0</b></u> <b>&lt;Actions></b> <i></i>
   <h4>AddSelected <i>...<a href="Events.htm#Suffix">FSARWO</a></i></h4>
   <s>Not attached to any event</s>
</div>
Adds new empty rows above actual or focused row. 
It adds the same number of rows as the selected rows.
The suffixes <b>FA</b> control destination (the position to add), the suffixes <b>SRWO</b> control source (the count).<br />

<!-- Action AddSelectedBelow -->
<a name="ActionsAddSelectedBelow"></a>
<div class="ACT">
   <u>new <b>12.0</b></u> <b>&lt;Actions></b> <i></i>
   <h4>AddSelectedBelow <i>...<a href="Events.htm#Suffix">FSARWO</a></i></h4>
   <s>Not attached to any event</s>
</div>
Adds new empty rows below actual or focused row. 
It adds the same number of rows as the selected rows.<br />
The suffixes <b>FA</b> control destination (the position to add), the suffixes <b>SRWO</b> control source (the count).<br />


<!-- OnCanRowAdd -->
<a name="OnCanRowAdd"></a>
<div class="API">
   <u>chg <b>12.0</b> <i>upd <b>16.1</b></i></u> <b>API event</b> <i>bool</i>
   <h4>OnCanRowAdd</h4>
   <s>(<i>TGrid</i> <b>grid</b>, <i>TRow</i> <b>parent</b>, <i>TRow</i> <b>next</b>)</s>
</div>
Called before the row is added to find out if it can be added to this position.<br /> 
It is called when adding new rows, copying existing rows and pasting rows. It is <u>not</u> called when moving rows from another grid.<br />
<i>parent</i> is parent row in tree or page for root row, to its children the new row will be added.<br /> 
<i>next</i> is next row, above it the new row will be added or null if the row will be added as the last child or last row on page.<br />
Return false to restrict row adding. <i>Since 12.0 returning null permits row adding.</i><br />
<i>Since 16.1</i> is possible to return array as [parent,next] to change to place where the row can be added.<br />

<!-- OnRowAdd -->
<a name="OnRowAdd"></a>
<div class="API">
   <u></u> <b>API event</b> <i>void</i>
   <h4>OnRowAdd</h4>
   <s>(<i>TGrid</i> <b>grid</b>, <i>TRow</i> <b>row</b>)</s>
</div>
Called after the row is added, but before it is displayed. Usually to change default values. Called from <a href="#AddRow">AddRow</a>.<br />

<!-- OnRowAdded -->
<a name="OnRowAdded"></a>
<div class="API">
   <u>new <b>7.0</b> <i>upd <b>14.0</b></i></u> <b>API event</b> <i>void</i>
   <h4>OnRowAdded</h4>
   <s>(<i>TGrid</i> <b>grid</b>, <i>TRow</i> <b>row</b>, <i>bool</i> <b>paste</b>)</s>
</div>
Called after the row is added and displayed.<br />
Called also when the row is copied, but not moved from another grid by dragging (MoveRowsToGrid).<br />
<i>Since 14.0</i> the <b>paste</b> is set if calling when pasting row.<br />

<!-- AddRow -->
<a name="AddRow"></a>
<div class="API">
   <u><i>upd <b>7.0</b></i></u> <b>API method</b> <i>TRow</i>
   <h4>AddRow</h4>
   <s>(<i>TRow</i> <b>parent</b>, <i>TRow</i> <b>next</b>, <i>int</i> <b>show</b> = 0, <i>string</i> <b>id</b> = null, <i>string</i> <b>Def</b> = null)</s>
</div>
Adds new empty row to grid and returns it.<br /> 
If <b>show&amp;1</b>, the new row is also displayed, for false there must be called <a href="RowVisibility.htm#ShowRow">ShowRow</a> method to display it.<br />
<i>(new 7.0)</i> If <b>show&amp;2</b>, the parents are expanded to show the row.<br />
<i>(new 7.0)</i> If <b>show&amp;4</b>, the row is recalculated, including Gantt chart.<br />
<i>(new 7.0)</i> Call with <tt><b>show</b> = 7</tt> to completely show the row.<br />
<b>parent</b> is parent row, <b>next</b> is row below the new row. If <b>next</b> is null adds new row as the last <b>parent's</b> child. If <b>parent</b> and <b>next</b> are null adds row as the last root row.<br />
Also sets values to new row from its default row (according to <a href="RowDefaults.htm#ICDef">CDef</a> attribute of parent row).<br /> 
If set <b>id</b>, sets it to <b>id</b> attribute, otherwise creates new unique id for the row.<br />
If set <b>Def</b>, uses this Def as Default row name.<br />
<i>Only variable row can be added.</i><br />

<!-- AddRows -->
<a name="AddRows"></a>
<div class="API">
   <u>new <b>12.0</b></u> <b>API method</b> <i>TRow[ ]</i>
   <h4>AddRows</h4>
   <s>(<i>int</i> <b>count</b>, <i>TRow</i> <b>parent</b>, <i>TRow</i> <b>next</b>, <i>bool</i> <b>focus</b> = 0, <i>bool</i> <b>test</b> = 0)</s>
</div>
Adds <b>count</b> of variable rows to given position (<b>parent</b> and/or <b>next</b>) and returns an array of them. Or returns null for error. <i>Since 15.0</i> for backward compatibility if set <b>count</b> = 0 it adds one row and returns it.<br />
If set <b>focus</b>, focuses the newly added rows, preserves the focused columns.<br />
If set <tt><b>test</b> = 1</tt>, does <u>not</u> add the rows, just test if it is possible and returns true or null.<br />
Uses <a href="#AddRow">AddRow</a> and also calls <a href="#OnCanRowAdd">OnCanRowAdd</a> and <a href="#OnRowAdded">OnRowAdded</a> API events and alerts error if the row cannot be added to given position.<br />

<!------------------------------------------------------------------ Copying existing rows -------------------------------------------------------------->
<a name="Copying"></a>
<h2>Copying existing rows</h2>

<!-- Copying -->
<a name="CfgCopying"></a>
<div class="XML">
   <u></u> <b>&lt;Cfg></b> <i>bool</i>
   <h4>Copying</h4><s>[1]</s>
</div>
If existing rows can be copied / duplicated.<br />
If set to <b>0</b>, the Panel Copy button is hidden and the CopyMenu does not display items for copying.<br />
If set to <b>0</b>, all <b>Copy</b>... actions fail but <a href="#CopyRow">CopyRow</a> and <a href="#CopyRows">CopyRows</a> methods still work.<br />
<i>(Since 10.0)</i> If set to <b>0</b>, the rows cannot be copied by dragging.<br />
Copying is automatically disabled when set <tt><a href="#CfgAdding">Adding</a>='0'</tt>.<br />
<i>It is <u>not</u> related to Copy&Paste, it is controlled by <a href="CopyPaste.htm#CfgPasting">Pasting</a>.</i><br />

<!-- CopyDeleted -->
<a name="CfgCopyDeleted"></a>
<div class="XML">
   <u>new <b>6.4</b></u> <b>&lt;Cfg></b> <i>bool</i>
   <h4>CopyDeleted</h4><s>[0]</s>
</div>
If copies also deleted rows.<br />

<!-- CanCopy -->
<a name="ICanCopy"></a>
<div class="XML">
   <u><i>upd <b>6.0</b></i></u> <b>&lt;I></b> <i>bool</i>
   <h4>CanCopy</h4><s>[1]</s>
</div>
If the row can be duplicated and copied.<br /> 
If set to <b>0</b>, the Panel Copy button is inactive and all <b>Copy</b>... actions fail but <a href="#CopyRow">CopyRow</a> and <a href="#CopyRows">CopyRows</a> methods still work.<br />
The row cannot be also copied by dragging.<br />
<i>It is <u>not</u> related to copying values into clipboard.</i><br />

<!-- CanCopy -->
<a name="HeaderCanCopy"></a>
<div class="XML">
   <u><i>upd <b>12.0</b></i></u> <b>&lt;Header></b> <i>bool</i>
   <h4>CanCopy</h4><s>[0]</s>
</div>
<b>Deprecated since <i>12.0.</i> Use Panel <a href="TypePanel.htm#CButtons">Buttons</a> or Panel value instead to define the panel buttons for header row.</b><br />
If the Header Panel Copy button is enabled. Header row itself can never be never copied.<br />

<!-- Copy -->
<a name="ICopy"></a>
<div class="XML">
   <u></u> <b>&lt;I></b> <i>string</i>
   <h4>Copy</h4>
   <s>Uploaded to server</s>
</div>
This attribute is set when used <tt><a href="PagingServer.htm#ChildPaging">ChildPaging</a>=3</tt> and the row was created as deep copy of another row, the Copy is <a href="RowId.htm#Iid">id</a> of the source row.<br />
This attribute is set only if the source row has some children and they were not loaded from server yet (the row was not expanded yet).<br />
The server script must provide deep copy of the children of source (Copy) node to children of this (id) node.<br />

<!-- Copy -->
<a name="PanelCopy"></a>
<div class="XML">
   <u><i>upd <b>6.0</b></i></u> <b>&lt;C></b> <i>bool</i>
   <h4>Copy</h4><s>[0]</s>
</div>
If the default Panel button <b>Copy</b> / <b>CopyAll</b> is visible. This button is hidden also if <tt>&lt;Cfg <a href="RowAdd.htm#CfgCopying">Copying</a>="0"/></tt>. This button is inactive when the row has <tt><a href="RowAdd.htm#ICanCopy">CanCopy</a>='0'</tt>.<br />
Click to this button shows popup menu for copying and adding rows. The menu is defined by attribute <a href="CellBasics.htm#CMenu">PanelCopyMenu</a>.<br />
<i>Used only if the Panel <a href="TypePanel.htm#CButtons">Buttons</a> and the cell value are <u>not</u> set.</i><br />

<!-- Action CopyRow -->
<a name="ActionsCopyRow"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>CopyRow <i>...<a href="Events.htm#Suffix">FA</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar Add</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Copies actual or focused row, the new row is placed above the source row.<br />

<!-- Action CopyRowBelow -->
<a name="ActionsCopyRowBelow"></a>
<div class="ACT">
   <u>new <b>6.0</b></u> <b>&lt;Actions></b> <i></i>
   <h4>CopyRowBelow <i>...<a href="Events.htm#Suffix">FA</a></i></h4>
   <s>Not attached to any event</s>
</div>
Copies actual or focused row, the new row is placed below the source row.<br />

<!-- Action CopyTree -->
<a name="ActionsCopyTree"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>CopyTree <i>...<a href="Events.htm#Suffix">FA</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar Add</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Copies actual or focused row with all its children, the new row is placed above the source row.<br />

<!-- Action CopyTreeBelow -->
<a name="ActionsCopyTreeBelow"></a>
<div class="ACT">
   <u>new <b>6.0</b></u> <b>&lt;Actions></b> <i></i>
   <h4>CopyTreeBelow <i>...<a href="Events.htm#Suffix">FA</a></i></h4>
   <s>Not attached to any event</s>
</div>
Copies actual or focused row with all its children, the new row is placed below the source row.<br />

<!-- Action CopyEmpty -->
<a name="ActionsCopyEmpty"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>CopyEmpty <i>...<a href="Events.htm#Suffix">FA</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar Add</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Copies actual or focused row with all children, but without their cell values, the new row is placed above the source row.<br />

<!-- Action CopyEmptyBelow -->
<a name="ActionsCopyEmptyBelow"></a>
<div class="ACT">
   <u>new <b>6.0</b></u> <b>&lt;Actions></b> <i></i>
   <h4>CopyEmptyBelow <i>...<a href="Events.htm#Suffix">FA</a></i></h4>
   <s>Not attached to any event</s>
</div>
Copies actual or focused row with all children, but without their cell values, the new row is placed below the source row.<br />

<!-- Action CopyRows -->
<a name="ActionsCopyRows"></a>
<div class="ACT">
   <u>new <b>12.0</b></u> <b>&lt;Actions></b> <i></i>
   <h4>CopyRows <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar Add</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Copies all focused rows, the new rows are placed above actual row or the focused range.<br />

<!-- Action CopyRowsBelow -->
<a name="ActionsCopyRowsBelow"></a>
<div class="ACT">
   <u>new <b>12.0</b></u> <b>&lt;Actions></b> <i></i>
   <h4>CopyRowsBelow <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event</s>
</div>
Copies all focused rows, the new rows are placed below actual row or the focused range.<br />

<!-- Action CopyRowsTree -->
<a name="ActionsCopyRowsTree"></a>
<div class="ACT">
   <u>new <b>12.0</b></u> <b>&lt;Actions></b> <i></i>
   <h4>CopyRowsTree <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar Add</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Copies all focused rows with all their children, the new rows are placed above actual row or the focused range.<br />

<!-- Action CopyRowsTreeBelow -->
<a name="ActionsCopyRowsTreeBelow"></a>
<div class="ACT">
   <u>new <b>12.0</b></u> <b>&lt;Actions></b> <i></i>
   <h4>CopyRowsTreeBelow <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event</s>
</div>
Copies all focused rows with all their children, the new rows are placed below actual row or the focused range.<br />

<!-- Action CopyRowsEmpty -->
<a name="ActionsCopyRowsEmpty"></a>
<div class="ACT">
   <u>new <b>12.0</b></u> <b>&lt;Actions></b> <i></i>
   <h4>CopyRowsEmpty <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar Add</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Copies all focused rows with all children, but without their cell values, the new rows are placed above actual row or the focused range.<br />

<!-- Action CopyRowsEmptyBelow -->
<a name="ActionsCopyRowsEmptyBelow"></a>
<div class="ACT">
   <u>new <b>12.0</b></u> <b>&lt;Actions></b> <i></i>
   <h4>CopyRowsEmptyBelow <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event</s>
</div>
Copies all focused rows with all children, but without their cell values, the new rows are placed below actual row or the focused range.<br />

<!-- Action CopySelected -->
<a name="ActionsCopySelected"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>CopySelected <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar Add</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Copies selected rows and places them above actual or focused row.<br />
It copies only rows that can be copied in the location.  It fails if no selected row can be copied to the location.<br />

<!-- Action CopySelectedChild -->
<a name="ActionsCopySelectedChild"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>CopySelectedChild <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar AddChild</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Like <a href="#ActionsCopySelected">CopySelected</a>, but copies the rows as the first children of actual or focused row.<br />

<!-- Action CopySelectedChildEnd -->
<a name="ActionsCopySelectedChildEnd"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>CopySelectedChildEnd <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar AddChild</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Like <a href="#ActionsCopySelected">CopySelected</a>, but copies the rows as the last children of actual or focused row.<br />

<!-- Action CopySelectedTree -->
<a name="ActionsCopySelectedTree"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>CopySelectedTree <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar Add</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Like <a href="#ActionsCopySelected">CopySelected</a>, but copies the selected rows with all their children.<br />

<!-- Action CopySelectedTreeChild -->
<a name="ActionsCopySelectedTreeChild"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>CopySelectedTreeChild <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar AddChild</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Like <a href="#ActionsCopySelectedTree">CopySelectedTree</a>, but copies the rows as the first children of actual or focused row.<br />

<!-- Action CopySelectedTreeChildEnd -->
<a name="ActionsCopySelectedTreeChildEnd"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>CopySelectedTreeChildEnd <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar AddChild</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Like <a href="#ActionsCopySelectedTree">CopySelectedTree</a>, but copies the rows as the last children of actual or focused row.<br />

<!-- Action CopySelectedEmpty -->
<a name="ActionsCopySelectedEmpty"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>CopySelectedEmpty <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar Add</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Like <a href="#ActionsCopySelected">CopySelected</a>, but copies the selected rows with all their children, but without their cell values.<br />

<!-- Action CopySelectedEmptyChild -->
<a name="ActionsCopySelectedEmptyChild"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>CopySelectedEmptyChild <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar AddChild</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Like <a href="#ActionsCopySelectedEmpty">CopySelectedEmpty</a>, but copies the rows as the first children of actual or focused row.<br />

<!-- Action CopySelectedEmptyChildEnd -->
<a name="ActionsCopySelectedEmptyChildEnd"></a>
<div class="ACT">
   <u></u> <b>&lt;Actions></b> <i></i>
   <h4>CopySelectedEmptyChildEnd <i>...<a href="Events.htm#Suffix">FARO</a></i></h4>
   <s>Not attached to any event, but used in <b>Toolbar AddChild</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Like <a href="#ActionsCopySelectedEmpty">CopySelectedEmpty</a>, but copies the rows as the last children of actual or focused row.<br />

<!-- Action CopySelectedEnd -->
<a name="ActionsCopySelectedEnd"></a>
<div class="ACT">
   <u><i>upd <b>6.0</b></i></u> <b>&lt;Actions></b> <i></i>
   <h4>CopySelectedEnd</h4>
   <s>Not attached to any event, but used in <b>Toolbar AddChild</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Like <a href="#ActionsCopySelected">CopySelected</a>, but copies the selected rows to end of grid (when <tt>&lt;Cfg AllPages='1'/></tt>) or actual page (when <tt>&lt;Cfg AllPages='0'/></tt>).<br />
There are also available actions <b><u>CopySelectedEndGrid</u></b> to copy to the grid end and <b><i>CopySelectedEndPage</i></b> to copy to actual page end.<br />

<!-- Action CopySelectedTreeEnd -->
<a name="ActionsCopySelectedTreeEnd"></a>
<div class="ACT">
   <u><i>upd <b>6.0</b></i></u> <b>&lt;Actions></b> <i></i>
   <h4>CopySelectedTreeEnd</h4>
   <s>Not attached to any event, but used in <b>Toolbar AddChild</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Like <a href="#ActionsCopySelectedEnd">CopySelectedEnd</a>, but copies the selected rows with all their children.<br />
There are also available actions <b><u>CopySelectedTreeEndGrid</u></b> to copy to the grid end and <b><u>CopySelectedTreeEndPage</u></b> to copy to actual page end.<br />

<!-- Action CopySelectedEmptyEnd -->
<a name="ActionsCopySelectedEmptyEnd"></a>
<div class="ACT">
   <u><i>upd <b>6.0</b></i></u> <b>&lt;Actions></b> <i></i>
   <h4>CopySelectedEmptyEnd</h4>
   <s>Not attached to any event, but used in <b>Toolbar AddChild</b> and <b>Panel</b> <a href="#PanelCopyMenu">CopyMenu</a></s>
</div>
Like <a href="#ActionsCopySelectedEnd">CopySelectedEnd</a>, but copies the selected rows with all their children, but without their cell values.<br />
There are also available actions <b><u>CopySelectedEmptyEndGrid</u></b> to copy to the grid end and <b><u>CopySelectedEmptyEndPage</u></b> to copy to actual page end.<br />

<!-- Action CopyMenu -->
<a name="ActionsCopyMenu"></a>
<div class="DEL">
   <u>deleted <b>12.0</b></u> <b>&lt;Actions></b> <i></i>
   <h4>CopyMenu <i>...F</i></h4>
   <s>Attached to <b>OnClickPanelCopy</b>, <b>OnClickButtonAdd</b> and <b>OnClickButtonAddChild</b></s>
</div>
Replaced by <a href="CellBasics.htm#ActionsShowMenu">ShowMenu</a> action.<br />
<del>Shows popup menu for copying or adding rows.  From this menu can be available all adding and copying actions listed above.<br />
The menu items displayed are set by column or row attribute <a href="#PanelCopyMenu">CopyMenu</a>. The menu items captions are set in <b>Text.xml</b>.</del><br />

<!-- Action CopyMenu -->
<a name="PanelCopyMenu"></a>
<div class="DEL">
   <u>new <b>6.0</b> deleted <b>12.0</b></u> <b style="width:155px;">&lt;Panel>&lt;Space cell></b> <i>string[ ]</i>
   <h4>CopyMenu</h4><s>[...]</s>
</div>
Replaced by <a href="CellBasics.htm#CMenu">Menu</a> attribute.<br />
<del>What items (and their order) will be available in menu displayed by <a href="#ActionsCopyMenu">CopyMenu</a> action - this actions attached to Panel <a href="#PanelCopy">Copy</a> button and Toolbar Button <a href="GlobalSettings.htm#ToolbarAdd">Add</a> and <a href="GlobalSettings.htm#ToolbarAddChild">AddChild</a> by default.</del><br />

<!-- OnRowCopy -->
<a name="OnRowCopy"></a>
<div class="API">
   <u><i>upd <b>6.4</b></i></u> <b>API event</b> <i>void</i>
   <h4>OnRowCopy</h4>
   <s>(<i>TGrid</i> <b>grid</b>, <i>TRow</i> <b>row</b>, <i>TRow</i> <b>source</b>, <i>bool</i> <b>empty</b>)</s>
</div>
Called after the row is copied, but before it is displayed. <b>row</b> is the copied row, source is the <b>source</b> row. <b>empty</b> is true if values were not copied.<br />
<i>Since 6.4 it is called also when pasting new row if set <tt><a href="CopyPaste.htm#CfgCopyPasteRows">CopyPasteRows</a>=1</tt>.</i><br />

<!-- OnRowCopyId -->
<a name="OnRowCopyId"></a>
<div class="API">
   <u>new <b>6.4</b> <i>upd <b>10.0</b></i></u> <b>API event</b> <i>bool</i>
   <h4>OnRowCopyId</h4>
   <s>(<i>TGrid</i> <b>grid</b>, <i>TRow</i> <b>row</b>, <i>TRow</i> <b>source</b>, <i>bool</i> <b>move</b>)</s>
</div>
Called before creating id for the new copied row, the row has already copied the IdNames columns, the other columns will be copied later.<br />
<i>Since 8.1</i> it can set the row id and return true to not generate the new id.<br />
<i>Since 10.0</i> <b>move</b> is set when the row is moved from another grid.<br />

<!-- CopyRow -->
<a name="CopyRow"></a>
<div class="API">
   <u>chg <b>7.0</b></u> <b>API method</b> <i>TRow</i>
   <h4>CopyRow</h4>
   <s>(<i>TRow</i> <b>row</b>, <i>TRow</i> <b>parent</b>, <i>TRow</i> <b>next</b>, <i>bool</i> <b>deep</b> = false, <i>bool</i> <b>empty</b> = false)</s>
</div>
Copies one row inside grid. Returns the row copy.<br />
<b>row</b> is the row to copy, it can be also from another grid,<br /> 
<b>parent</b> is parent row, <b>next</b> is row below the copied row. If <b>next</b> is null, places the row as the last <b>parent's</b> child. If <b>parent</b> and <b>next</b> are null, places row as the last root row.<br />
If <b>deep</b> is true, copies include children, only visible (not filtered, not deleted).<br /> 
Copies all row and cell attributes. Does <u>not</u> copy RowSpan.<br />
<i>Since 7.0 it also shows all the changes and tests if the copy is possible due Def / AcceptDef settings.</i><br />

<!-- CopyRows -->
<a name="CopyRows"></a>
<div class="API">
   <u>chg <b>7.0</b> <i>upd <b>12.0</b></i></u> <b>API method</b> <i>TRow[ ]</i>
   <h4>CopyRows</h4>
   <s>(<i>TRow[ ]</i> <b>rows</b>, <i>TRow</i> <b>parent</b>, <i>TRow</i> <b>next</b>, <i>bool</i> <b>deep</b> = false, <i>bool</i> <b>empty</b> = false, <i>bool</i> <b>focus</b> = false)</s>
</div>
Copies all given rows inside grid. Shows all changes.<br />
<b>rows</b> is array of the rows to copy in this order. The rows can be also from another grid.<br />
<b>parent</b> is parent row, <b>next</b> is row below the copied rows. If <b>next</b> is null, places the <b>rows</b> as the last <b>parent's</b> children. If <b>parent</b> and <b>next</b> are null, places rows as the last root rows.<br />
If <b>deep</b> is true, copies include children, only visible (not filtered, not deleted).<br /> 
<i>(since 12.0)</i> If set <b>focus</b>, focuses the newly added rows, preserves the focused columns.<br />
Copies all row and cell attributes. Does <u>not</u> copy RowSpan.<br />
Uses <a href="#AddRow">AddRow</a> and also calls <a href="#OnCanRowAdd">OnCanRowAdd</a> and <a href="#OnRowAdded">OnRowAdded</a> API events.<br />
<i>(since 12.0)</i> Returns all new added rows (but no their children). Or null for error.<br />
<i>In 7.0 was removed parameter dest_grid and <b>rows</b> now can become from another grid.</i><br />

</div>
</body>	
</html>